The present invention relates to a communication method and a communication apparatus. More particularly, the invention relates to a communication method and a communication apparatus whereby a TCP connection is maintained if an end point of that TCP connection is moved between computers or if a computer where an end point of the connection resides is relocated over the Internet.
Over a computer network, protocols such as the TCP (Transmission Control Protocol) are used to ensure reliable communications between computers. As shown in FIG. 7, the TCP establishes a logical communication channel (called a TCP connection) between computers prior to communication therebetween. The TCP acts as highly dependable connection type protocol. To perpetuate its reliable operation, the TCP possesses such functions as sequence control, acknowledgment, window control and flow control.
The TCP transfers data to an IP (Internet Protocol) in units called segments. Each segment is made up of a TCP header field and an application field, as illustrated in FIG. 8. In the TCP header field, a source port number (16 bits) represents a port number, used by the TCP, of a transmission source. A destination port number (16 bits) denotes a port number, also used by the TCP, of a transmission destination.
A sequence number (32 bits) indicates the position of the segment in question in a data stream to be transferred. When a connection is established, the sequence number is initialized. Thereafter, the sequence number is counted up every time a data transmission takes place. Even if IP datagrams are not transmitted in sequence, the initial data stream is reproduced on the basis of the sequence numbers involved. If the same segment is found to be received in duplicate as evidenced by a duplicate sequence number, the duplicate segment is discarded.
An acknowledge number (32 bits), to be returned to the transmission source, is the sequence number of the most recent segment normally received and incremented by 1, i.e., the sequence number of the segment to be received next. The source checks to see if the received acknowledge number coincides with the sequence number of the segment to be transmitted next. If the two numbers match, normal communication is confirmed.
It may happen that an acknowledge number fails to arrive within a predetermined period of time because transmitted data or an acknowledge number has been lost in transit for some reason (retransmission time-out). In that case, a retransmission process takes place.
A data offset (4 bits) indicates the size of the TCP header field in units of four octets (32 bits). As such, the data offset denotes the starting position of data within the segment. A value of 5 is set to the data offset if no option is included.
Code bits (6 bits) are constituted by the following six-bit control flags each indicating status: a URG (urgent flag) indicates the presence of data to be dealt with urgently. The position of the data is indicated by an urgency pointer, to be described later. An ACK (acknowledgment flag) indicates the current use of an acknowledge number. A PSH (push flag), when set, requires that received data be handed over immediately to an application layer. An RST (reset flag) denotes forced disconnection. A SYN (synchronize flag), used when a connection is established, initializes the sequence number. A FIN (finish flag) indicates the completion of a connection.
A window (16 bits) indicates the size of a buffer furnished for window control. Window control is a function that allows a plurality of segments to be transmitted, within the size of a buffer, continuously without waiting for the receipt of an acknowledge number. When the process of acknowledgment is omitted, data transmission is carried out all the more efficiently. If data cannot be received for some reason, the window size may be varied so as to effect suitable flow control.
A checksum (16 bits) is used to verify whether transmitted data have been corrupted in transit. An urgency pointer (16 bits) indicates the position of data to be dealt with when the above-mentioned URG flag is set.
A TCP connection is defined by a pair of end point identifiers (EndPointID), one representing a local end point, the other denoting a remote end point as shown below. EQU TCP connection={EndPointID_local, EndPointID_remote}
Each end point identifier of the TCP connection is defined by a combination of an IP address and a port number as shown below. EQU EndPointID={IPaddr, port}
Thus the TCP connection is defined by the following four items of identification: ##EQU1##
Conventionally, if an end point of an TCP connection is moved from one computer to another, that connection cannot be maintained because the IP address is changed. Likewise, if a computer wherein an end point of a TCP connection resides is relocated on the Internet, that TCP connection cannot be maintained as well because of the change in the IP address.